package exercise6;

public class Int {
	private int value;

	public Int() {

	}

	public Int(int value) {
		this.value = value;
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

	public boolean isPrime(int number) {
		value = number;
		boolean isprime = true;
		int len = value / 2;
		for (int i = 2; i < len; i++) {
			if (value % i == 0) {
				isprime = false;
				break;
			}
		}
		return isprime;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + value;
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Int other = (Int) obj;
		if (value != other.value)
			return false;
		return true;
	}

	public boolean isEven(int number) {
		value = number;
		Boolean iseven = true;
		if (value % 2 != 0) {
			iseven = false;
		}
		return iseven;
	}
}
